//
//  WLMessageCell.m
//  WanLian
//
//  Created by muzhuang on 2018/10/16.
//  Copyright © 2018年 wanlian. All rights reserved.
//

#import "WLMessageCell.h"

@implementation WLMessageCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _btnHead = [[UIButton alloc] initWithFrame:CGRectMake(WLScaleX(16), WLScaleX(17), WLScaleX(36), WLScaleX(36))];
//        if (indexPath.row%2==0) {
//            [_btnChange setImage:[UIImage imageNamed:@"msg_system"]
//        }
//        else
//        {
//            [_btnChange setImage:[UIImage imageNamed:@"msg_common"] forState:UIControlStateNormal];
//        }
        _btnHead.userInteractionEnabled = NO;
        [self.contentView addSubview:_btnHead];
        _btnHead.layer.cornerRadius = WLScaleX(18);
        _btnHead.layer.masksToBounds = YES;
        
        _labTitle = [[UILabel alloc] initWithFrame:CGRectMake(WLScaleX(16)+WLScaleX(48), WLScaleX(15), WLScaleX(180), WLScaleX(20))];
        _labTitle.font = [WLCommonTool fontTypePingFangSCMedium:14];
        _labTitle.textColor = wlBlackColor;
        [self.contentView addSubview:_labTitle];
        
        _labDetail = [[UILabel alloc] initWithFrame:CGRectMake(WLScaleX(16)+WLScaleX(48), WLScaleX(35), WLScaleX(250), WLScaleX(20))];
        _labDetail.font = [WLCommonTool fontTypePingFangSCMedium:11];
        _labDetail.textColor = wlLightTextColor;
        [self.contentView addSubview:_labDetail];
        
        _ivLink = [[UIImageView alloc] initWithFrame:CGRectMake(WLScaleX(16)+WLScaleX(48)+45, CGRectGetMidY(_labDetail.frame)-5, 21, 10)];
        _ivLink.image = [UIImage imageNamed:@"msg_link"];
        [self.contentView addSubview:_ivLink];
        _ivLink.hidden = YES;
        
        _labTime = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH_SCREEN_WL-WLScaleX(100)-WLScaleX(15), WLScaleX(20), WLScaleX(100), WLScaleX(20))];
        _labTime.textAlignment = NSTextAlignmentRight;
        _labTime.font = [WLCommonTool fontTypePingFangSCRegular:11];
        _labTime.textColor = wlLightTextColor;
        [self.contentView addSubview:_labTime];
        
        _vUnread = [[UIView alloc] initWithFrame:CGRectMake(WIDTH_SCREEN_WL-WLScaleX(22), WLScaleX(42), WLScaleX(6), WLScaleX(6))];
        _vUnread.backgroundColor = wlRedColor;
        [self.contentView addSubview:_vUnread];
        _vUnread.layer.cornerRadius = WLScaleX(3);
//        _vUnread.layer.masksToBounds = YES;
        _vUnread.hidden = YES;
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
